<%@page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Login</title>
        <c:import url="/WEB-INF/formating/link.jsp"/>
    </head>

    <body>
        <c:import url="/WEB-INF/formating/menu.jsp"/>
        <div id="conteiner">
            <c:import url="/WEB-INF/formating/sideMenu.jsp"/>
            <div id="main">
                <h1>Login</h1>
                <c:if test="${not empty param.login_error}">
                    <font color="red">
                        Your login attempt was not successful, try again.<br/><br/>
                        Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
                    </font>
                </c:if>

                <form name="spring_security_form" action="j_spring_security_check" method="POST">
                    <label for="j_username">Username</label>
                    <input type="text" name="j_username" id="j_username" <c:if test="${not empty param.login_error}">value='<%= session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY)%>'</c:if>/>
                    <br/>
                    <label for="j_password">Password</label>
                    <input type="password" name="j_password" id="j_password"/>
                    <br/>
                    <input type='checkbox' name='_spring_security_remember_me'/> Remember me on this computer.
                    <br/>
                    <input type="submit" value="Login"/>
                </form>

            </div>
        </div>
        <c:import url="/WEB-INF/formating/foot.jsp"/>
    </body>
</html>